//
// Created by denglibin on 2021/4/16.
//
#include "stdio.h"
#include "double_link_list.h"
int main_linklist(){
    DoubleLinkList* list = createDoubleLinkList(10);
    for(int i = 0; i < 10; i++){
        insertTail(list, createNode(i, i));
    }
    printList(list);

    Node* head = popHead(list);
    printf("pop head:\n");
    printNode(head);
    freeNode(head);

    printf("after pop head:\n");
    printList(list);

    Node* tail = popTail(list);
    printf("pop tail:\n");
    printNode(tail);
    freeNode(tail);

    printf("after pop tail:\n");
    printList(list);

    removeHead(list);
    printf("after remove head:\n");
    printList(list);


    removeTail(list);
    printf("after remove tail:\n");
    printList(list);

    freeDoubleLinkList(list);
    return 0;
}
